home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Games / NetHack 3.1.3 / source / sys / unix / Install.unx < prev    next >
Encoding:
Text File  |  1993-08-01  |  11.9 KB  |  210 lines  |  [TEXT/R*ch]

  1.                 Instructions for installing NetHack 3.1
  2.                            on a UNIX system
  3.                 =======================================
  4.  
  5. 0.  Read this entire file before starting, and come back to the Notes
  6.     below if you have any problems.  If you are trying to use X11,
  7.     also read all of win/X11/Install.X11.  For help in controlling
  8.     and running the game after it is installed, see the '?' command
  9.     within the game and doc/Guidebook (non-installers want to know
  10.     about those things too).
  11.  
  12. 1.  Make sure all the NetHack files are in the appropriate directory
  13.     structure.  You should have a main directory with subdirectories dat,
  14.     doc, include, src, util, sys/share, sys/unix, win/tty, and win/X11.
  15.     You may have other subdirectories under sys and win, but they will not
  16.     affect compilation for a UNIX system.  If you do not follow this
  17.     structure, the Makefiles will not function properly.  The .c files for
  18.     the main program belong in src, those for utility programs in util, and
  19.     UNIX-specific ones in sys/unix.  All the .h files belong in include, the
  20.     documentation in doc, and assorted data files in dat.  Some UNIX
  21.     versions may also be interested in sys/share's random.c or its lex/yacc
  22.     output, as explained in note 11.  (A more detailed explanation of the
  23.     directory structure may be found in Files, which should be in the top
  24.     directory.)
  25.  
  26. 2.  Your Makefiles may still be in sys/unix with tags on the end of them.
  27.     If so, run setup.sh in that directory to distribute the Makefiles to
  28.     places they can do their work.  (If later official patches change
  29.     these Makefiles, setup.sh should be rerun to make sure you use the
  30.     current copies.)
  31.  
  32. 3.  Go to the include subdirectory and edit config.h according to the
  33.     comments to match your system and desired set of features.  Similarly
  34.     edit unixconf.h.  Please see the "Notes:" section, below, for some
  35.     configuration hints for particular systems.
  36.  
  37. 4.  If you want to, look through system.h.  This file attempts to match the
  38.     types for system calls and library routines with various flavors of
  39.     operating systems.  Leaving this file alone is unlikely to cause worse
  40.     problems than lint errors, but it's worth checking if you get compile
  41.     errors, especially if you have an unusual system.
  42.  
  43. 5.  Go to the src subdirectory and look at the top of topten.c.  You may want
  44.     to change the definitions of PERSMAX and PERS_IS_UID here to get different
  45.     behavior from the high score list.
  46.  
  47. 6.  Edit the top sections of the src and util Makefiles.  (If you are doing
  48.     a full recompile, or if you got your files from someplace besides the
  49.     official distribution, type 'touch makedefs.c' to make sure certain files
  50.     (onames.h, pm.h) get remade instead of relying on the potentially
  51.     troublesome timestamps.)  Then type 'make' in src and go get a cup of
  52.     coffee or take a nap.  You should now have created the game executable.
  53.  
  54. 7.  Go back to the top directory and edit that Makefile, explaining where
  55.     you want everything to be installed.  Make sure that you follow the
  56.     comments about setting GAMEDIR.  The Makefile assumes you want to
  57.     run NetHack setuid 'games' to cut down on possible tampering; it's
  58.     fairly straightforward to comment out the appropriate chmod if you
  59.     don't want that, or to change any of the rest of the procedure.  (Note
  60.     that if you don't want to run NetHack either setuid or setgid, and
  61.     people in more than one group will be playing it, you'll need to go back
  62.     and set FCMASK to 0666 in unixconf.h and let everybody fiddle with the
  63.     files NetHack creates.)  Type 'make all' from the top directory to
  64.     set up all the auxiliary files the main executable will use.
  65.     Then become root if necessary and type 'make install'.  Everything
  66.     should now be set.
  67.  
  68. Notes:
  69.  
  70. 1.  Save files and bones files from previous versions will not work with
  71.     NetHack 3.1.2.  Don't bother trying to keep them.
  72.  
  73. 2.  To install an update of this version of NetHack after changing something,
  74.     type 'make update' from the main directory.  If you created the new
  75.     version yourself, it should be safe to use 'make update' as long as you
  76.     did not add, delete, or reorder monsters or objects and you did not change
  77.     the format of saved level files.  If you did any of these things, you
  78.     should also remove any saved games and bones levels.  (Trying to use such
  79.     files often produces amusing but useless confusions on the game's part.)
  80.  
  81. 3.  If you insisted on doing the final installation by hand, you probably
  82.     forgot to make a save directory.  If you don't go back and do this, you
  83.     won't be able to save games.
  84.  
  85. 4.  If you get unexplained deaths by trickery, you are probably running
  86.     NetHack on a bunch of workstations, but you have overlooked the NETWORK
  87.     definition in unixconf.h that is necessary in that configuration.
  88.  
  89. 5.  If spurious characters appear on the screen while throwing, kicking,
  90.     zapping, etc., it is likely that you have linked the source to the wrong
  91.     library or mistakenly defined/undefined TERMINFO.  A number of systems,
  92.     such as Xenix, support both the termcap and terminfo terminal capability
  93.     libraries.  In such cases, the TERMINFO definition in config.h and the
  94.     WINTTYLIB definition in the source Makefile must correspond.
  95.  
  96.     If your terminal library does not provide suitable delays, NetHack will
  97.     try to fake its own if you set the nonull option.
  98.  
  99. 6.  Since NetHack overflows the stock C preprocessors for AT&T 3b1 and 3b2
  100.     systems ("too many defines"), we are including an alternate preprocessor
  101.     to allow these folks to compile.  This is the DECUS cpp by Martin Minow,
  102.     slightly modified by Kevin Darcy to use larger buffers, be less verbose,
  103.     and handle strange constructs in AT&T's include files.
  104.  
  105.     To use this preprocessor, unpack the cpp* files found in sys/unix into
  106.     some handy directory (util will do).  For the AT&T machines mentioned
  107.     above, nothing needs to be configured; you should get a working cpp by
  108.     merely typing "make -f makefile.txt".  To get your compiler to use the
  109.     new cpp, you will have to add to CFLAGS in src/Makefile and util/Makefile.
  110.     If you put the cpp files in /foo/bar/util, add "-B/foo/bar/util/ -tp"
  111.     for a 3b1 or "-Yp,/foo/bar/util" for a 3b2.
  112.  
  113.     For any other machine whose preprocessor can't handle the NetHack source,
  114.     you'll have to play it by ear.  The preprocessor has many esoteric
  115.     configuration options, but most probably you will only need to change
  116.     the flags in makefile.txt, and then refer to your compiler's documentation
  117.     to find the appropriate CFLAGS for the NetHack Makefiles.  (The SunOS flag,
  118.     for instance, would be "-Qpath /foo/bar/util", although the native cpp
  119.     has no trouble with NetHack.  So much for standardization.)
  120.  
  121. 7.  If you are trying to compile NetHack on an AT&T 3B that is running an
  122.     OS earlier than SVR3, you are likely to have problems with overflowing
  123.     symbol tables.  This can be worked around by editing the source Makefile
  124.     to make the Sys.3B2 target work more like the SysV-AT target, adding
  125.     -DDUMB to CFLAGS and DUMB.Setup to the Sys.3B2 dependency line.  The
  126.     compiler provided with later versions of the OS has a large enough
  127.     symbol table that it does not need this workaround.
  128.  
  129. 8.  If NetHack seems to compile fine, starts up, allows you to pick a
  130.     character, and then either hangs or gets a segmentation fault, you
  131.     might try changing the schar and uchar definitions in config.h to
  132.     short ints.  This problem is known to occur on the AT&T 3B series,
  133.     Silicon Graphics Irises, and IBM systems (PC/RT & RS/6000) running AIX,
  134.     and may occur on other computers as well.
  135.  
  136.     This problem is really most likely caused by having a non-__STDC__
  137.     compiler with char's unsigned by default.  Since some such compilers
  138.     don't understand the new "signed" keyword, and others don't have signed
  139.     characters to use (the 3B2 line falls into this category), "signed"
  140.     is #ifdefed away for them.  If you are sure your compiler can deal
  141.     with it, you can add your compiler to the __HC__ case in tradstdc.h.
  142.  
  143.     Alternatively, if the compiler supports a command line switch for
  144.     setting the default char type to signed, you could try setting it in
  145.     the Makefiles.  The appropriate switch for SGI Irises with MIPS C
  146.     compiler is "-signed" and for RS/6000's with standard cc "-qchars=signed".
  147.     Note that at least RS/6000's seem to like this method better but there
  148.     is also a problem:  The lexers created by the standard lex program in
  149.     AIX may come out faulty when this switch is used (known to happen at
  150.     least in AIX 3.1.3), so you may have to use an alternative, like flex,
  151.     which is available at major archive sites (see notes 10 and 11).
  152.  
  153. 9.  Under SCO UNIX, you may have all sorts of complaints about
  154.     include/obj.h.  Go to the file and uncomment the marked line, working
  155.     around the fact that SCO's system include files preempt a major
  156.     NetHack structure name.  Also, there are difficulties with SCO's cc
  157.     that thus far have been solved only by changing compilers; one report
  158.     says gcc-NetHack works, and another says rcc-NetHack can be made to
  159.     work by defining NOTSTDC, applying note 8, and compiling with -tinfo
  160.     and -xenix.  The cc problems are old enough that a new, working
  161.     version may have been released by this time.
  162.  
  163. 10. Xenix/286's lex generates a faulty lexical analyser from lev_comp.l.
  164.     The beta-release of flex 2.3 (available from uunet, osu-cis,
  165.     prep.ai.mit.edu, etc.) can be used to generate the lexer.
  166.     The only change to flex is to change "#define yyleng (yy_cp - yy_bp)"
  167.     to "#define yyleng (int)(yy_cp - yy_bp)" in flex.skel.
  168.     Flex is not needed with Xenix/386, as its lex generates a proper lexical
  169.     analyser.  [Xenix instructions by J.T. Conklin]
  170.  
  171. 11. If your system does not have a lex/yacc or flex/bison combination
  172.     capable of producing the dungeon and level compilers, lex and yacc
  173.     output from one of our development systems can be found in sys/share.
  174.     Unfortunately, this output is less portable than the rest of the code,
  175.     as it contains skeleton parsing code provided by the specific vendor
  176.     who has no particular incentive to make such skeletons portable, but
  177.     the output works on most systems.  To try it on yours, copy dgn_comp.h
  178.     and lev_comp.h to include and dgn_lex.c, dgn_yacc.c, lev_lex.c, and
  179.     lev_yacc.c to util.
  180.  
  181. 12. Yes, Virginia, you compile NetHack for a NeXT as if it ran UNIX instead
  182.     of Mach.  Just tell NetHack you're a BSD system.  (Mach is extremely
  183.     close to BSD UNIX for traditional system calls, so this is also a
  184.     likely thing to try for any other programs you want to compile.)
  185.  
  186. 13. If you are unlucky enough to have SunOS5.x (aka Solaris) you must take
  187.     special care when configuring config.h and unixconf.h.  Solaris is
  188.     basically a SVR4 system, not a BSD system.  Therefore, you configure
  189.     config.h and unixconf.h as per a SVR4 system:
  190.  
  191.     config.h: UNIX, TERMINFO, TTY_GRAPHICS
  192.     unixconf.h: SYSV, SVR4, POSIX_JOB_CONTROL, POSIX_TYPES
  193.  
  194.     X11_GRAPHICS (and the related OPENWINBUG) is untested under SunOS5.x.
  195.     You may safely define NETWORK, TEXTCOLOR if desired.
  196.     Other #defines in these files may be defined too, as needed.  Just make
  197.     sure that the set mentioned here are not misdefined, or your compile
  198.     will fail (do _not_ define BSD or SUNOS4).
  199.  
  200.     When compiling, make sure that you use the ANSI C SVR4 compatible
  201.     compiler, /usr/bin/cc, or gcc, but _not_ ucbcc.  The lattermost will
  202.     not work.  After this, you should get a clean compile.
  203.  
  204. 14. If your machine is a 286, 386, or 486 running an appropriate OS, you
  205.     may wish to use the console speaker driver included in
  206.     sys/unix/snd86unx.shr.  This will allow audible music to be played
  207.     on your console speaker in certain appropriate game situations.  The only
  208.     modification to the main-line code needed to enable use of the driver
  209.     is defining UNIX386MUSIC or VPIX_MUSIC in unixconf.h.
  210.